#ifndef CATEGORYMODEL_H
#define CATEGORYMODEL_H

/*
 * tungvc :
 *
 */

#include <QObject>
#include <QtQml/qqml.h>
#include <QString>
#include <QAbstractListModel>
#include <QStringList>
#include "newspaper/sourcedetail.h"
#include <QtQml/qqml.h>

class CategoryListModel : public QAbstractListModel
{
    Q_OBJECT
public:
    enum CategoryRoles {
        IdRole = Qt::UserRole + 1,
    };

    CategoryListModel(QObject *parent = 0);


    void addSourceInfo(const int categoryId);

    int rowCount(const QModelIndex & parent = QModelIndex()) const;

    QVariant data(const QModelIndex & index, int role = Qt::DisplayRole) const;

    void setSourceInfo(const QList<int>& listSourceInfo);

    void clear();
protected:
    QHash<int, QByteArray> roleNames() const;

private:
    QList<int > m_listCategory;
};


QML_DECLARE_TYPE(CategoryListModel)

#endif // MAGEZIGEITEMMODEL_H
